<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>start</title>
    <link rel="stylesheet" type="text/css" href="assect/css/bootstrap.min.css">
    <script src="assect/js/angular.min.js"></script>
</head>
<body style="padding: 10px" ng-app="myApp" ng-controller="myCtrl">
    <div class="input-group">
        <input ng-model="task" type="text" class="form-control">
        <span class="input-group-btn">
            <button class="btn btn-default" ng-click="add()">提交</button>
        </span>
    </div>
    <h4 ng-if="tasks.length>0">任务列表</h4>
    <ul class="list-group">
        <li ng-repeat="item in tasks track by $index" class="list-group-item">
            {{item}}<a ng-click="tasks.splice($index,1)">删除</a>
        </li>
    </ul>

<script>
    var app= angular.module('myApp',[]);
    app.controller('myCtrl',function($scope){
        $scope.task = "wx";
        $scope.tasks = ['123'];
        $scope.add = function(){
            $scope.tasks.push($scope.task);
        }
    });
</script>
</body>
</html>